package day0106;

import org.junit.Test;

public class DoubleFor {
	@Test
	public void test2() {
		for (int i = 1; i <= 4; i++) {
			System.out.print("*");   //print打印不换行
		}
		System.out.println();  // 打印一个换行
		for (int i = 1; i <= 4; i++) {
			System.out.println("*"); // println 打印换行
		}
	}
	
	
	
	
	
	@Test
	public void test1() {
		// 外层循环控制打印的行数
		for (int i = 1; i <= 5; i++) {  
			// 内层循环控制每行打印多少个
			for (int j = 1; j <= 5; j++) {
				System.out.print("*"); 
			}
			System.out.println();
		}
	}
	
	@Test
	public void test3() {
		for (int i = 1; i <= 5; i++) {  
			for (int j = 1; j <= i; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}
	
	// 99乘法表
	@Test
	public void test5() {
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(j + "x" + i + "=" + j * i + "\t"); //  \t制表符  产生间隔
			}
			System.out.println();
		}
	}
}
